package com.hxt.util;

import java.util.Map;

import com.google.common.collect.Maps;

public class PageUtil {

	public static Map<String, Object> getCurrentPage(int pageIndex, int pageSize) {
		
		Map<String, Object> pageParam = Maps.newHashMap();
		if(pageSize==-1 && pageIndex==-1)
		{
			return pageParam;
		}
		
		if (pageIndex <= 0) {
			pageIndex = 1;// 默认值为1
		}
		pageIndex = (pageIndex - 1) * pageSize;
		pageParam.put("pageIndex", pageIndex);
		pageParam.put("pageSize", pageSize);
		return pageParam;
	}

}
